import { createSlice } from "@reduxjs/toolkit";

const createslice = createSlice({
  name: "count",
  initialState: {
    count: 0,
  },
  reducers: {
    increment: (state, { type, payload }) => {
      state.count += payload;
    },
    decrement: (state, { type, payload }) => {
      state.count -= payload;
    },
  },
});

export const CountReducer = createslice.reducer;

export const { increment, decrement } = createslice.actions;
